<template>
  <div class="shopcart-container">
    <!-- 收货地址区域 -->
    <div class="address-container">
      <div class="card">
        <h3>
          {{ this.order.order_address.name }}
          {{ this.order.order_address.tel }}
        </h3>
        <br />
        <p>{{ this.order.order_address.address }}</p>
      </div>
    </div>

    <!-- 商品列表 -->
    <div class="goods-list">
      <!-- 商品列表项区域 -->

      <div class="card">
        <div
          class="card-content"
          v-for="item in order.goods_list"
          :key="item.goods_id"
        >
          <div class="card-content-inner flex">
            <img :src="item.goods_small_logo" />
            <div class="info">
              <h1>{{ item.goods_name }}</h1>
              <p class="flex">
                <span class="price">¥{{ item.goods_price }}</span>
                <span>x{{ item.num }}</span>
              </p>
            </div>
          </div>
        </div>

        <!-- 配送信息 -->
        <div class="process-info">
          <p>
            <strong>配送服务</strong>
            <strong>快递运输</strong>
          </p>
          <br />
          <p>
            <span>中小件送货时间</span>
            <span>工作日、双休日与节假日均可送货</span>
          </p>
        </div>
        <!-- 订单备注 -->
        <div class="store-info">
          <strong>订单备注</strong><br /><br />
          <textarea
            disabled
            :value="this.order.note"
            type="text"
            placeholder="选填，给商家留言"
          ></textarea>
        </div>
      </div>
    </div>
    <!-- 运费信息 -->
    <ul class="fare-info card">
      <li class="fare-price flex">
        <span>商品金额</span>
        <span class="red">¥{{ this.order.order_price }}</span>
      </li>
      <li class="fare-price flex">
        <span>运费</span>
        <span class="red">¥0.00</span>
      </li>
      <li class="fare-price flex">
        <span><strong>总价</strong></span>
        <span class="red">¥{{ this.order.order_price }}</span>
      </li>
    </ul>
  </div>
</template>
<script>
import { mapGetters } from "vuex";

export default {
  data() {
    return {
      order: {},
    };
  },
  computed: {
    ...mapGetters("order", { orderlist: "getOrderlist" }),
  },
  created() {
    this.order = this.orderlist[this.$route.params.i];
    console.log(this.order);
  },
  methods: {},
};
</script>
<style lang="scss" scoped>
.flex {
  display: flex;
}

.shopcart-container {
  overflow: hidden;
  // 收货地址
  .address-container {
    border-bottom: 2px solid #eee;

    .card {
      margin: 0;
      padding: 15px;
      h3 {
        color: #333;
        font-size: 16px;
        font-weight: bold;
      }
    }
  }

  // 商品列表
  .goods-list {
    margin-top: 10px;
    .card {
      margin: 0;
      .card-content {
        border-bottom: 1px solid #eee;
        .card-content-inner {
          align-items: center;
          padding: 15px;
          img {
            width: 60px;
          }
          .info {
            margin-left: 10px;
            box-sizing: border-box;
            width: 100%;
            overflow: hidden;
            h1 {
              font-size: 13px;
              font-weight: bold;
              line-height: 20px;
              padding-top: 22px;
            }
            p {
              flex-direction: row;
              align-items: center;
              justify-content: space-between;
              .price {
                font-size: 16px;
                font-weight: 700;
                color: red;
                flex: 1;
              }
            }
          }
        }
      }
      // 配送信息
      .process-info {
        padding: 15px;
        border-bottom: 1px solid #eee;
        p {
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: space-between;
          color: #333;
          span {
            color: #999;
          }
        }
      }
      // 店铺备注
      .store-info {
        padding: 10px;
        textarea {
          font-size: 13px;
          width: 100%;
          height: 50px;
        }
      }
    }
  }
  // 运费信息
  .fare-info {
    padding: 15px;
    margin: 10px 0 0 0;
    .fare-price {
      padding: 5px 0;
      display: flex;
      justify-content: space-between;
      .red {
        color: red;
        font-size: 16px;
      }
    }
  }
}
</style>
